import React, { Component } from 'react';

export default class MenuExampleColoredInverted extends Component {
  state = { hover:false };
  handleMouseInter = () => this.setState({ hover: true })
  handleMouseLeave = () => this.setState({ hover: false })
  render(){
    const { hover } = this.state;
    const { children,active,disable,action } = this.props;
    const click = disable ? undefined : action
    let classString = "label-item label-buttonItem label-h4 ";
    if (hover === true && !disable) {
      classString += "label-itemHover "; 
    }
    if(active){
      classString += "label-itemActive "; 
    }
    if (disable){
      classString += "label-itemDisabled "; 
    }
    return (
      <React.Fragment>
        <a 
          className={ classString } 
          onMouseEnter={() => this.handleMouseInter()}
          onMouseLeave={() => this.handleMouseLeave()}
          onClick={click}
        >
          {children}
        </a>
        <b className="label-clear" />
      </React.Fragment>
    );
  }
}